-
Notifications
You must be signed in to change notification settings - Fork 179
chore(components): Converted 24 component files from class-based to functional #342
chore(components): Converted 24 component files from class-based to functional #342
Conversation
56ae73f
to
32f98d2
Compare
src/components/CreateAddress/HardwareWalletPublicKeyImporter.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This is awesome! Thanks so much for taking the time to do these upgrades. I have a couple small nits and comments. There's also a merge conflict to resolve. I'd like to try and do a full walk-thru as well but overall I didn't see any real red flags.
render = () => { | ||
const { status, bip32Path, publicKeyError } = this.state; | ||
const interaction = this.interaction(); | ||
const [status, setStatus] = useState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move this up to the other useStates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an oversight on my part. Line 41 uses this.interaction
to initialize the state. I think the this.
needs to be removed, but the state still has to be initialized after line 32 where we declare interaction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, didn't even notice the this
.
I think hoisting should make it irrelevant in terms of order. Something else to consider is that you can use useState or useCallback to set the interaction and set it to a default as well. That's probably safer anyway to handle the state changes as well anyway which addresses the comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. No that's a fine rule to have.
And yeah, that's the change I was thinking of. In addition (or maybe instead?) as a way to keep the order consistent you can use the state to set the interaction, which I did in another component here for a similar conversion a while ago (obviously we could use more).
In any case, this is a non-blocking nit from me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this looks good great to me! I still want to try and run through some user flows to confirm, and I also need to figure out how to coordinate with some other big PRs we have in the pipeline and hopefully coordinate one big release.
Got a linting error to resolve:
|
Oh sorry about that! I think I can fix it quickly... |
Ok @bucko13 I think it should be good to go now. |
So, I ran through some manual tests on the current commit (see version and hash in the bottom right hand corner). Most things I tested worked:
I ran into a bug though when trying to upload a partially signed PSBT for a signing flow in the wallet. The field is disabled: Whereas on the live version of caravan this is what it looks like: I think this should be a quick fix though as I'm seeing this error in the console:
(Unfortunately caravan isn't as well tested as it should be, either that or the imminent typescript support would've helped catch this I bet). Once I've confirmed that's working I think this should be good to go! |
Gotcha. I'll work on it this evening! Sorry about this 😵 |
Looks like there was a pre-existing issue with one of the default propTypes in Commit 70d0cb1 |
Awesome. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😶🌫️ |
Description
Does this PR introduce a breaking change?
Does this PR fix an open issue?